<?php

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Laravel\Passport\HasApiTokens;

class User extends Authenticatable
{
    use HasApiTokens, Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'phone', 'name', 'password', 'nike_name', 'open_id', 'avatar', 'session_key', 'extended_data', 'begin_at', 'end_at', 'is_able'
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

    protected $casts = [
        'extended_data' => 'array',
        'begin_at' => 'date:Y-m-d',
        'end_at' => 'date:Y-m-d',
    ];

}
